﻿/**
 * The AudioTrack Library by Chris J. Rock. Aug 10, 2011
 * Check out chrisjrock.net and be a king among men.
 *
 * Copyright (c) 2011 Chris J. Rock
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 **/


package net.chrisjrock.sound.audioTrack.track
{
	import flash.events.IEventDispatcher;
	import flash.media.SoundTransform;
	
	import net.chrisjrock.sound.audioTrack.data.IAudioTrackData;
	import net.chrisjrock.sound.audioTrack.mixer.IAudioMixer;
	
	/**
	 * ...
	 * @author Christopher J. Rock
	 */
	public interface IAudioTrack extends IEventDispatcher
	{
		/**
		 * Disposes of the track. 
		 * 
		 */		
		function dispose():void;
		
		//---Identical to AudioTrackData, but purposely kept separate
		/**
		 * Creates a copy track. 
		 * @return 
		 * 
		 */		
		function cloneData ():IAudioTrackData;
		
		/**
		 * Returns a SoundTransform object that reflects the current state of the mixer. 
		 * @return 
		 * 
		 */		
		function getTransform ():SoundTransform;
		
		/**
		 * Sets the data to a given SoundTransform object. 
		 * @param transform
		 * 
		 */
		function updateTransform (transform:SoundTransform = null):void;
		
		/**
		 * A unique identifier for individual tracks. This property may be used as a key to store
		 * tracks so it is important that is unique.
		 */
		function get trackId ():String;
		
		/**
		 * @private
		 */
		function set trackId (value:String):void;
		
		/**
		 * Returns the track's parent mixer. 
		 * @return 
		 * 
		 */		
		function get mixer ():IAudioMixer;
		
		/**
		 * @private
		 */		
		function set mixer (value:IAudioMixer):void;
		
		/**
		 * Returns the effect data of the track. These data represent the concatenation of the track's
		 * effects and its parent mixer's effects. It is the total effect applied to the track.
		 * @return 
		 * 
		 */		
		function get effect ():IAudioTrackData;
		
		/**
		 * Determines whether a track is muted. 
		 * @return 
		 * 
		 */
		function get mute ():Boolean;
		
		/**
		 * @private
		 */
		function set mute (value:Boolean):void;
		
		/**
		 * Determines whether a track is soloed (depends to some extent on the mixer in which it is soloed). 
		 * @return 
		 * 
		 */
		function get solo ():Boolean;
		
		/**
		 * @private
		 */
		function set solo (value:Boolean):void;
		
		/**
		 * Determines the stereophonic pan of the track. 
		 * @return 
		 * 
		 */		
		function get pan ():Number;
		
		/**
		 * @private
		 */
		function set pan (value:Number):void;
		
		/**
		 * Determines the volume of the track. 
		 * @return 
		 * 
		 */		
		function get volume ():Number;
		
		/**
		 * @private
		 */
		function set volume (value:Number):void;
	}
	
}